package com.biboheart.demo.report.repository.service.impl;

import com.biboheart.demo.report.repository.dao.SettleOrderItemsRepository;
import com.biboheart.demo.report.repository.entity.SettleOrderItems;
import com.biboheart.demo.report.repository.service.SettleOrderItemsService;
import com.biboheart.demo.report.support.jpa.Specifications;
import lombok.RequiredArgsConstructor;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
public class SettleOrderItemsServiceImpl implements SettleOrderItemsService {
    private final SettleOrderItemsRepository settleOrderItemsRepository;

    @Override
    public List<SettleOrderItems> list(Long start, Long end) {
        Specification<SettleOrderItems> spec = Specifications.timeSpec("endTime", start, end);
        return settleOrderItemsRepository.findAll(spec);
    }
}
